Add a Consumer Account
'AddAccount-Consumer' API enables to create new individual customer account
Bank or financial institution can create new account for an individual customer by using this API. On providing the individual customer details including required account type as request, the account is created for the customer with the generation of unique account ID and number.
Method: POST
{{URL}}/jsonrpc
Headers
Name | Value |
---|---|
Content-Type | application/json |
Example
Payload Parameters
Parameter | Description |
---|---|
method Mandatory | String API method that is being called to add new consumer account through customer service Constant value: "CustomerService.AddAccount" |
id Mandatory | String Unique ID of API request Sample value: "1" |
params Mandatory | Object |
api Mandatory | Object |
signature Mandatory | String Signature for request validation Sample value: "signature" |
keyId Mandatory | String API key used for request authentication Sample value: "ApplicationKeyId" |
credential Mandatory | String API credential provided by NetXD Sample value: "Credential" |
payload Mandatory | Object |
customerID Mandatory | String Unique ID that identifies the customer information of individual customer Sample value: "100000000052004" |
name Mandatory | String Name of the customer associated with the ID Sample value: "Dave" |
accountType Mandatory | Enum Type of new account created for the individual customer Valid values:
Sample value: "WALLET" |
currency Mandatory | String Currency in which the account transactions are denominated Sample value: "USD" |
activityAccountNumber Optional | String The pool account under which the newly created consumer account to be added Sample value: "900309799403557" |
- cURL
- C#
- Go
- NodeJS
curl --location --globoff '{{URL}}/jsonrpc' \
--header 'Content-Type: application/json' \
--data '{"method":"CustomerService.AddAccount","id":"1","params":{"api":{"signature":"{{signature}}","keyId":"{{ApplicationKeyId}}","credential":"{{Credential}}"},"payload":{"customerID":"100000000052004","name":"DAVE","accountType":"WALLET","currency":"USD","activityAccountNumber":"900309799403557"}}}'
var options = new RestClientOptions("{{URL}}/jsonrpc")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
var body = @"{
" + "\n" +
@" ""method"": ""CustomerService.AddAccount"",
" + "\n" +
@" ""id"": ""1"",
" + "\n" +
@" ""params"": {
" + "\n" +
@" ""api"": {
" + "\n" +
@" ""signature"": ""{{signature}}"",
" + "\n" +
@" ""keyId"": ""{{ApplicationKeyId}}"",
" + "\n" +
@" ""credential"": ""{{Credential}}""
" + "\n" +
@" },
" + "\n" +
@" ""payload"": {
" + "\n" +
@" ""customerID"": ""100000000052004"",
" + "\n" +
@" ""name"": ""DAVE"",
" + "\n" +
@" ""accountType"": ""WALLET"",
" + "\n" +
@" ""currency"": ""USD"" ,
" + "\n" +
@" ""activityAccountNumber"": ""900309799403557""
" + "\n" +
@" }
" + "\n" +
@" }
" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "{{URL}}/jsonrpc"
method := "POST"
payload := strings.NewReader(`{`+"
"+`
"method": "CustomerService.AddAccount",`+"
"+`
"id": "1",`+"
"+`
"params": {`+"
"+`
"api": {`+"
"+`
"signature": "{{signature}}",`+"
"+`
"keyId": "{{ApplicationKeyId}}",`+"
"+`
"credential": "{{Credential}}"`+"
"+`
},`+"
"+`
"payload": {`+"
"+`
"customerID": "100000000052004",`+"
"+`
"name": "DAVE",`+"
"+`
"accountType": "WALLET",`+"
"+`
"currency": "USD",`+"
"+`
"activityAccountNumber": "900309799403557"`+"
"+`
}`+"
"+`
}`+"
"+`
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': '{{URL}}',
'path': '/jsonrpc',
'headers': {
'Content-Type': 'application/json'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"method": "CustomerService.AddAccount",
"id": "1",
"params": {
"api": {
"signature": "{{signature}}",
"keyId": "{{ApplicationKeyId}}",
"credential": "{{Credential}}"
},
"payload": {
"customerID": "100000000052004",
"name": "DAVE",
"accountType": "WALLET",
"currency": "USD",
"activityAccountNumber":"900309799403557"
}
}
});
req.write(postData);
req.end();
Body
{
"method": "CustomerService.AddAccount",
"id": "1",
"params": {
"api": {
"signature": "{{signature}}",
"keyId": "{{ApplicationKeyId}}",
"credential": "{{Credential}}"
},
"payload": {
"customerID": "100000000052004",
"name": "DAVE",
"accountType": "WALLET", // If account type is 'CUSTODIAL', 'CustodialCustomerId' and 'custodialType' fields are mandatory
"currency": "USD",
"activityAccountNumber":"900309799403557"
}
}
}
Response: 200
Response Parameters
Parameter | Description |
---|---|
id | String Response ID echoed from the request ID Sample value: "1" |
result | Object |
ID | String Unique ID generated for newly created individual customer account Sample value: "3173041" |
status | Enum Status of the newly added account Valid values:
Sample value: "ACTIVE" |
accountNumber | String Account number that is newly assigned for individual customer Sample value: "200982345048071" |
accountType | Enum Type of account newly created for the individual customer Valid values:
Sample value: "WALLET" |
institutionID | String Routing number of the financial institution where customer holds the account Sample value: "101115399" |
customerID | String Unique ID that identifies the individual customer Sample value: "100000000052004" |
jsonrpc | String JSON RPC version Constant value: "2.0" |
{
"id": "1",
"result": {
"ID": "3173041",
"status": "ACTIVE",
"accountNumber": "200982345048071",
"accountType": "WALLET",
"institutionID": "101115399",
"customerID": "100000000052004"
},
"jsonrpc": "2.0"
}